﻿using System.Collections.Generic;

namespace AccelerateSensor.Service.DbProxy.SQLite.Bll
{
    internal class GatewayPrivateAttribute
    {
        private readonly Dal.GatewayPrivateAttribute _dal = new Dal.GatewayPrivateAttribute();

        /// <summary>
        /// 添加网关私有属性
        /// </summary>
        /// <param name="model">网关私有属性对象</param>
        /// <returns>Rid</returns>
        public int Add(Models.GatewayPrivateAttribute model)
        {
            return _dal.Insert(model);
        }

        /// <summary>
        /// 批量添加网关私有属性
        /// </summary>
        /// <param name="models">网关私有属性对象集合</param>
        /// <returns>true成功，false失败</returns>
        public bool Add(List<Models.GatewayPrivateAttribute> models)
        {
            return _dal.Insert(models);
        }

        /// <summary>
        /// 更新网关私有属性
        /// </summary>
        /// <param name="model">网关私有属性对象</param>
        /// <returns>true成功，false失败</returns>
        public bool Update(Models.GatewayPrivateAttribute model)
        {
            return _dal.Update(model);
        }

        /// <summary>
        /// 通过网关编号更新网关私有属性
        /// </summary>
        /// <param name="model">网关私有属性对象</param>
        /// <returns>true成功，false失败</returns>
        public bool UpdateByGatewayUuid(Models.GatewayPrivateAttribute model)
        {
            return _dal.UpdateByGatewayUuid(model);
        }

        /// <summary>
        /// 删除网关私有属性
        /// </summary>
        /// <param name="model">网关私有属性对象</param>
        /// <returns>true成功，false失败</returns>
        public bool Delete(Models.GatewayPrivateAttribute model)
        {
            return _dal.Delete(model);
        }

        /// <summary>
        /// 查询网关私有属性
        /// </summary>
        /// <param name="rid">网关私有属性id</param>
        /// <returns>网关私有属性对象</returns>
        public Models.GatewayPrivateAttribute GetModel(int rid)
        {
            return _dal.GetModel(rid);
        }

        /// <summary>
        /// 查询所有网关私有属性
        /// </summary>
        /// <returns>网关私有属性对象集合</returns>
        public List<Models.GatewayPrivateAttribute> GetAllModels()
        {
            return _dal.GetAllModels();
        }
    }
}
